#include "stdafx.h"
#include "TextureRegisterManager.h"
#include "GraphicsManager.h"

TextureRegisterManager::TextureRegisterManager(void)
{

}

TextureRegisterManager::~TextureRegisterManager(void)
{

}

void TextureRegisterManager::SetTexture(IGraphicsResource* texture, PiplineIndex index)
{
	ID3D11ShaderResourceView* srv = texture->getSrv();
	ID3D11DeviceContext* context = GraphicsManager::GetInstance()->getDeviceContext();

	switch (index.shader_index)
	{
	case SHADER_INDEX_VERTEX_SHADER:
		context->VSSetShaderResources(index.slot, 1, &srv);
		break;
	case SHADER_INDEX_PIXEL_SHADER:
		context->PSSetShaderResources(index.slot, 1, &srv);
		break;
	case SHADER_INDEX_GEOMETRY_SHADER:
		context->GSSetShaderResources(index.slot, 1, &srv);
		break;
	}
}